package com.zany.children.dao;

import com.zany.children.vo.PaymentProject;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import java.util.List;
import java.util.Map;

public class PaymentProjectDaoImpl extends SqlMapClientDaoSupport implements PaymentProjectDao {


    @Override
    public List<PaymentProject> getPaymentProjectListPage(PaymentProject paymentProject) {

        List list = getSqlMapClientTemplate().queryForList("paymentproject.getPaymentProjectListPage", paymentProject);
        return list;
    }

    @Override
    public Integer getPaymentProjectListPageCount(PaymentProject paymentProject) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("paymentproject.getPaymentProjectListPageCount", paymentProject);
        return count;
    }

    @Override
    public Long savePaymentProject(PaymentProject paymentProject) {
        Long id = (Long) getSqlMapClientTemplate().insert("paymentproject.savePaymentProject", paymentProject);
        return id;
    }

    @Override
    public void updatePaymentProject(PaymentProject paymentProject) {
        getSqlMapClientTemplate().update("paymentproject.updatePaymentProject", paymentProject);
    }

    @Override
    public void deletePaymentProjectById(Long id) {
        getSqlMapClientTemplate().update("paymentproject.deletePaymentProjectById", id);
    }


    @Override
    public PaymentProject getPaymentProjectById(Long id) {
        return (PaymentProject) getSqlMapClientTemplate().queryForObject("paymentproject.getPaymentProjectById", id);
    }

    @Override
    public List<PaymentProject> getPaymentProject(Map<String, Object> map) {
        List list = getSqlMapClientTemplate().queryForList("paymentproject.getPaymentProject", map);
        return list;
    }
}
